Blended velocity estimation

ABSTRACT

A system and method for calculating the speed of a moving member having an output device providing an output periodic signal as a function of displacement of the moving member includes measuring a time duration for a plurality of first periodic occurrences of the output periodic signal to occur. A number of second periodic occurrences of the output periodic signal is also counted in a selected time period. A speed of the moving member is calculated as a function of the time duration for the plurality of first periodic occurrences to occur and the number of second periodic occurrences to occur in the selected time period.

CROSS-REFERENCE TO RELATED APPLICATION

This application is based on and claims priority of Provisional PatentApplication Ser. No. 60/110,583, filed Dec. 2, 1998, the content ofwhich is also hereby incorporated by reference in its entirety.

BACKGROUND OF THE INVENTION

The present invention relates to motion control systems. Moreparticularly, the present invention relates to a method and system forestimating a speed of a moving member in the motion control system.

In many motion control systems (rotary or linear), it is necessary toknow the speed or velocity of a moving member in order to properlycontrol the moving member. Typically, speed or velocity is determined asa function of displacement of the moving member. For instance, aposition sensor, such as an encoder, provides a periodic output signalas a function of displacement. A first method of determining speed ofthe moving member includes counting the number of occurrences (e.g.,edges of a square wave) in a selected time period. This technique canprovide accurate estimates of the speed of the moving memberparticularly when higher speeds are present. However, when the movingmember is traveling at a slow rate of speed, less accurate estimates areobtained.

A second technique of speed estimation includes measuring the timebetween successive occurrences of the periodic output signal. Thistechnique provides accurate estimates of the velocity of the movingmember when the moving member is traveling slowly. However, at higherrates of speed, less accurate results are obtained.

Accordingly, there is an ongoing need to provide an accurate system andmethod for estimating the speed of a moving member at slow and highrates of speed.

SUMMARY OF THE INVENTION

A system and method for calculating the speed of a moving member havingan output device providing an output periodic signal as a function ofdisplacement of the moving member includes measuring a time duration fora plurality of first periodic occurrences of the output periodic signalto occur. A number of second periodic occurrences of the output periodicsignal is also counted in a selected time period. A speed of the movingmember is calculated as a function of the time duration for theplurality of first periodic occurrences to occur and the number ofsecond periodic occurrences to occur in the selected time period.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a block diagram of a motion control system.

FIG. 2 is a flow chart of a method for calculating the speed of a movingmember according to the present invention.

FIG. 3 is a signal diagram pictorially illustrating the method of FIG.2.

FIGS. 4A, 4B and 4C are a block diagram of an exemplary edge detectioncircuit.

FIGS. 5A and 5B are a flow chart of an exemplary method for calculatingthe speed of a moving member.

DETAILED DESCRIPTION OF THE ILLUSTRATIVE EMBODIMENTS

FIG. 1 schematically illustrates a motion control system 10 comprisingan electric motor 12 and a motor drive 14. Typically, based on a commandinput 16, the motor drive 14 provides energization signals 18 toenergize stator windings 20 of the electric motor 12. As is well knownin the art, energization of the stator windings, in turn, causesmovement of a rotor 22. A position sensor 24, such as an encoder, aresolver, Hall-effect switches, or the like, provide a feedback outputsignal 26 to the motor drive 14 indicative of a position of the rotor22. The electric motor 12 can be a rotating motor where the rotor 22rotates relative to the stator windings 20, or a linear motor, whereinthe rotor 22 and the stator windings 20 move linearly with respect toeach other. It should also be noted that although depicted herein wherethe moving member comprises a rotor or a stator assembly of the electricmotor 12, this is but one exemplary embodiment and that the method andsystem described below for calculating the speed of a moving member canalso be applied to other apparatuses wherein a position sensor providesan output periodic signal as a function of displacement of the movingmember.

FIG. 3 pictorially illustrates an exemplary feedback signal or outputsignal 26 of a position sensor 24, comprising an encoder. Generally, theoutput signal 26 is a periodic signal comprising a square wave that isproduced as a function of the position of the rotor 22. In thisembodiment, the feedback or output signal 26 comprises periodic signals26A and 26B. Each periodic signal 26A and 26B is a square wave. Feedbacksignal 26B is substantially in quadrature with respect to signal 26A (aphase shift of 90°). Use of quadrature feedback signals is well known inthe art; however, the present invention is not limited to use of twoperiodic output signals, but can also be used with a single outputsignal, or more than two output signals. As appreciated by those skilledin the art, the use of quadrature output signals allows the direction ofthe moving member (herein rotor 22) to be determined.

FIG. 2 illustrates a method 40 for calculating the speed of the movingmember using an output periodic signal that is a function ofdisplacement of the moving member. The method 40 includes a step 42 ofmeasuring a time duration 44 (FIG. 3) for a plurality of first periodicoccurrences of the output periodic signal 26 to occur. At step 46, anumber of second periodic occurrences of the output periodic signal 26are counted in a selected time period 48. of course, steps 42 and 46 canbe interchanged it desired. At step 50, the speed of the moving memberis calculated as a function of the time duration 44 for the plurality offirst periodic occurrences to occur and the number of second periodicoccurrences to occur in the selected time period 48.

In the embodiment illustrated in FIG. 3, the first periodic occurrencesand the second periodic occurrences each comprise either rising orfalling edges 52 of the feedback signals 26A and 26B. In the illustratedembodiment, all of the edges 52 (periodic occurrences) are used. Inother words, each of the first periodic occurrences and each of thesecond periodic occurrences are the same feature of the output signal26. However, in other embodiments, the first periodic occurrences couldbe only rising edges whereas the second periodic occurrences could beonly the falling edges, or vice-versa. Likewise, if desired, some of theedges can be skipped. As appreciated by those skilled in the art, manyvariations can be used. It should also be noted that althoughillustrated wherein the output periodic signal 26 comprises squarewaves, analog signals (e.g. sine waves) or other periodic output signalscan also be used. For instance, the first periodic occurrences of ananalog signal can be when the analog signal reaches a first threshold,while the second periodic occurrences can be when the analog signalreaches the same threshold, or a different threshold.

Referring to FIG. 3, the speed of the moving member is calculated as afunction of;

Speed=K*N/T  Eq. 1

where,

N is the number of second periodic occurrences in the selected timeperiod 48,

T is the measured time duration 44 for the plurality of first periodicoccurrences to occur, and

K is a scaling value.

The scaling value K can be calculated or determined based on eachspecific application. For instance, the scaling value X can beascertained by use of the following equation:

K=M*P/E  Eq. 2

where,

M is the maximum value of speed of the moving member,

P is the selected time period 48, and

E is the number of periodic occurrences in the selected time period 48at maximum speed.

FIGS. 4A, 4B and 4C illustrate a circuit to detect the edges (periodicoccurrences) of the output signals 26A and 26B of FIG. 3. In short, thecircuit counts the periodic occurrences and provides a running count toa controller 64 (herein a processor) for calculating the time duration44. The processor 64 includes a module or program 65 that receives thecount indicating the occurrence of an edge. The module 65 comprises aset of instructions stored in a processor readable medium. The set ofinstructions are operable on the processor 64 for counting the number ofedges or occurrences in the selected time period 48, which is determinedby the processor 64. Similarly, the processor 64 also receives values ofa counter indicating the time duration 44 for a fixed number of periodicoccurrences to occur. The module 65 of the processor 64 uses theforegoing information in the manner described above to calculate thespeed of the moving member. If desired, module 65 can comprise circuitryto process the foregoing information rather than software.

Referring to FIG. 4A, signals 26A and 26B are applied to an edgedetection and direction circuit 70. Output signals from the edgedetection and direction circuit 70 include an output on a signal line 72indicative of when an edge has occurred whereas an output on signal line74 is indicative of the current direction of the moving member.Flip-flops 76-79 and logic gates 80 are used to determine whether outputsignal 26A leads or follows output signal 26B. Gates 82 are used todetect proper edge occurrences.

Referring to FIG. 4B, upon the selected occurrences of an edge, acounter 90 is incremented in the embodiment illustrated. The directionoutput on signal line 74 is also provided to the processor 64, and isfurther used to control operation of the counter 90. Flip-flop 92receives the output value indicative of the occurrence of an edge on asignal line 72 and the output value indicative of the direction of themoving member on signal line 74. The flip-flop 92 delays the directionvalue by one clock cycle, the output of which is provided on signal line94 as “DIR 1”.

At this point, it should be noted that an edge selection circuit 100also receives the output on signal line 72 indicative of the occurrenceof an edge. The circuit 100 includes a counter 102, AND gates 104 and amultiplexer 106. The circuit 100 provides a modified signal indicativeof edge occurrences wherein an output signal 10B herein denoted as “CNTOK” is provided for every edge that is detected, every other edge thatis detected, or every fourth edge that is detected. The signal “CNT OK”is used to increment the counter 90. External command inputs 110 and112, such as from the processor 64, or from external switches at inputsS1 and S0 of the multiplexer 106, are used to select whether every edge,every other edge, or every fourth edge will be used to increment thecounter 90. Logic gates 120 reset the counter 90 if the directionchanges.

In the embodiment illustrated, a latch 122 receives the value from thecounter 90 indicating the number of edges detected, which is thentransferred to the processor 64. A flip-flop circuit 124 provides a“latch” signal having a duration of one clock pulse. When the “latch”signal goes low, the counter 90 is reset and simultaneously, the outputvalues 126 of the counter 90 are provided to the latch 122 for temporarystorage. As stated above, the processor 64 determines the fixed samplingperiod or selected time period 48. Accordingly, periodically, at somefixed rate, the processor 64 will obtain the data from the latch 122. Inorder to reset the counter 90, the processor 64 will write a “one” to aflip-flop 130, the output of which is provided to a flip-flop 132. Theflip-flops 130 and 132 create a “latch” signal 134, which will go lowfor one clock cycle. The latch signal 134 is provided to OR gate 135,which, in turn, is connected to the “reset” terminal of the counter 90and to the “enable” terminal of the latch 122. Accordingly, when thelatch signal 134 goes low, the counter 90 is reset and the output of thecounter 90 is provided to the latch 122. The latch signal 134 is furtherprovided to a flip-flop 140 (FIG. 4C), which also receives the valueindicative of direction from flip-flop 92. The output of flip-flop 144is provided to the processor 64 and indicates the current direction ofthe moving member. Flip-flop circuit 150 (FIG. 4C) provides anindication to the processor 64 of any change in direction by the movingmember.

Referring to FIG. 4C, timing circuit 160 measures the time duration 44between a selected number of edges as indicated in FIG. 3 as ten edges.Timing circuit 160 includes a counter 162, a latch 164, a multiplexer166 and a latch 168. Counter 162 is a reference counter having valuesindicative of a lapsed time. The latch 164 receives at an “enable” inputthe same signal 108 provided to counter 90 indicative of the occurrenceof an edge. The latch 164 thus stores the value of the counter 162 atthe occurrence of each edge. At the same time that the value of the edgecounter 90 is provided to the latch 122, described above, the value inthe latch 164 or the current value of the counter 162 is transferred tothe latch 168 through the multiplexer 164. In particular, the currentvalue of the counter 162 is transferred to the latch 166 until the firstedge has been detected. Referring back to edge counter 90, the outputscomprise a plurality of signals 126, which are also provided to a gatearray indicated at 174, having an output 176. The output 176 is providedas an input to the multiplexer 166. The output of the gate array 174will be a 1 if no edges have been detected wherein the multiplexer 166provides the current value of the counter 162 to the latch 168. Once anedge has been detected, the output 176 of the gate array 174 is low,which causes the multiplexer 166 to select the value stored in latch164, which in turn, is then transferred to latch 168. The processor 64receives each of the values stored in the latch 168 sequentially and byknowing what each value is indicative of can calculate the time duration44 between a selected number of edges. The counter 162 can be reset upona change of direction of the moving member.

It should be noted that by passing the current value of the counter 162to the latch 168 and then subsequently to the processor 64 until thefirst edge is received, this technique allows measurements of time overa relatively long duration. In this manner, slow speeds of the movingmember can be calculated.

In summary, the processor receives values indicative of the number ofedges from latch 122, the time values of each edge received from thelatch 16B, whether the direction of the moving member has changed fromcircuit 150 and the current direction of the moving member fromflip-flop 140FIGS. 5A and 5E illustrate an exemplary method 200 forcalculating the speed of the moving member based on these values. Step202 represents receipt of the values from each of the latches 122 and168, the circuit 150 and the flip-flop 140. At step 204, the valuerepresentative of a change in direction is examined. In the embodimentillustrated, if the value is high, indicating a change in direction,program flow continues to step 206 where it is assumed that the velocityof the moving member is zero. At step 208, the value from latch 168 isstored as “time total” and a shift register is set to 15 at step 210.The method flow is complete for this iteration as represented at step212. Program flow then returns to step 202 where the values from latches122 and 168, the circuit 150 and the flip-flop 140 are read once again.As appreciated by those skilled in the art, execution of the method 200illustrated in FIGS. 5A and 5B occurs frequently, for example, onceevery 100 microseconds. Since the value indicating a change in directionof the moving member is momentary (e.g. 100 microseconds, it is safe toassume that the moving member has zero velocity when the value of thechange in direction is high.

Returning back to decision block 204, if the value indicative of thechange in direction of the moving member is low, indicating no change indirection, a value “time change” is calculated at step 220. In effect,the value “time change” is indicative of the time between sequentialedges. After the “time change” has been calculated, the time value issaved as “old time” at step 222. At step 224, the value “time total” isincremented according to the following equation:

Time Total=Time Total*Time Change*2^(Shift)

As appreciated by those skilled in the art, use of the “shift” valueallows binary arithmetic. Of course, other calculating techniques canalso be used.

At decision block 226, the value of “time total” is examined toascertain if it is a large number. In the embodiment illustrated, bit 30is examined, and if bit 30 is high, the value of time total is dividedby 2 as indicated at step 228. Program flow then continues to step 230where the shift register is decremented by one.

At decision block 232, the program ascertains if any edges have beendetected yet. If an edge has been detected, program flow continues tostep 234 where the speed of the moving member is calculated according tothe following equation:

Speed=VSC1*N*2^(Shift−VSC2)/Time Total

The above equation is of the form found in equation 1 where K has beenseparated into velocity scaling parameters VSC1 and VSC2, which aredetermined based on each application. VSC1 can be considered proportionto K whereas VSC2 can be considered a power of K. By using VSC1 andVSC2, wide ranges of K can be accommodated and binary arithmetic can beused. After the speed has been calculated at step 264, the value “timetotal” is reset to zero at step 236, and the shift register is reset to15 at step 238. At decision block 240, the direction of the movingmember is examined. If the direction is high, the velocity is reportedas equal to the speed at step 242. In contrast, if the directionvariable is low, the velocity is reported as the negative of the speedat step 244.

Returning back to decision block 232, if the number of edges detected isless than or equal to zero, program flow continues to decision block250. At decision block 250, the quantity (shift−VSC2) is examined todetermine if it is less than zero. If this quantity is less than zero,program flow continues to step 252 where the velocity is reported to bezero since an edge has not been detected for a long time. At step 254,the value “time total” is set to a high default value and at step 256,the shift register is set equal to the parameter VSC2. If, on the otherhand, the quantity (shift minus VSC2) is greater than zero, indicatingthat an edge has not yet been detected, but an excessive amount of timehas not yet elapsed, program flow continues to step 212, and then backto step 202 to allow another iteration to determine if an edge is onceagain detected. In this manner, slow speeds of the moving member can bedetected.

Although the present invention has been described with reference topreferred embodiments, workers skilled in the art will recognize thatchanges may be made in form and detail without departing from the spiritand scope of the invention.

What is claimed is:
 1. A method for calculating the speed of a movingmember having an output device providing an output periodic signal as afunction of displacement of the moving member, the method comprising:selecting whether to count every periodic occurrence, every otherperiodic occurrence, or every fourth periodic occurrence; measuring atime duration for a plurality of first periodic occurrences of theoutput periodic signal to occur, wherein every periodic occurrence,every other or every fourth periodic occurrence is counted; counting anumber of second periodic occurrences of the output periodic signal tooccur in a selected time period, wherein every periodic occurrence,every other or every fourth periodic occurrence is counted; andcalculating a speed of the moving member as a function of the timeduration for the plurality of first periodic occurrences to occur andthe number of second periodic occurrences to occur in the selected timeperiod.
 2. The method of claim 1 wherein calculating includescalculating the speed of the moving member as a function of; Speed=K*N/Twhere, N is the number of second periodic occurrences in the selectedtime period, T is the time duration for the plurality of first periodicoccurrences to occur, and K is a scaling value.
 3. The method of claim 2wherein the first and second periodic occurrences comprise a digitalsignal.
 4. The method of claim 2 wherein the first and second periodicoccurrences comprise an analog signal.
 5. The method of claim 1 whereinthe moving member comprises a rotating member.
 6. The method of claim 1wherein the moving member comprises a linear moving member.
 7. Themethod of claim 1 wherein measuring a time duration comprises countingoccurrences of a reference signal.
 8. The method of claim 7 wherein thereference signal comprises a counter signal, and wherein measuring atime duration comprises storing a value of the number of occurrences ofthe reference signal each time a set of the plurality of first periodicoccurrences has occurred, and subtracting a previous value from acurrent value.
 9. The method of claim 1 wherein the output devicecomprises at least one of an encoder, a resolver and a Hall-effectsensor.
 10. The method of claim 1 wherein each of the first periodicoccurrences and each of the second periodic occurrences are the samefeature of the output periodic signal.
 11. An apparatus for calculatinga speed of a moving member, the apparatus comprising: an output deviceproviding an output periodic signal as a function of displacement of themoving member; a selection device receiving the output periodic signaland selecting whether to count every periodic occurrence, every otherperiodic occurrence, or every fourth periodic occurrence; a measuringdevice providing a time duration output indicative of a time durationfor a plurality of first periodic occurrences of the output periodicsignal to occur, wherein every periodic occurrence, every other or everyfourth periodic occurrence is counted; a counter providing a counteroutput indicative of a number of second periodic occurrences of theoutput periodic signal to occur in a selected time period, wherein everyperiodic occurrence, every other or every fourth periodic occurrence iscounted; and a module receiving the time duration output and the counteroutput and calculating a speed of the moving member as a function of thetime duration output and the counter output.
 12. The apparatus of claim11 wherein the module calculates the speed of the moving member as afunction of: Speed=K*N/T where, N is the number of second periodicoccurrences in the selected time period, T is the time duration for theplurality of first periodic occurrences to occur, and K is a scalingvalue.
 13. The apparatus of claim 11 wherein the output periodic signalcomprises a digital signal.
 14. The apparatus of claim 11 wherein theoutput periodic signal comprises an analog signal.
 15. The apparatus ofclaim 11 wherein the module comprises a processing circuit.
 16. Theapparatus of claim 11 and further comprising a processor, and whereinthe module comprises a set of instructions stored in a processorreadable medium, the set of instructions operable on the processor. 17.The apparatus of claim 11 wherein each of the first periodic occurrencesand each of the second periodic occurrences are the same feature of theoutput periodic signal.
 18. The apparatus of claim 11 wherein the outputdevice comprises at least one of an encoder, a resolver and aHall-effect sensor.
 19. An electric motor comprising: a stator windingassembly; a rotor movable relative to the stator winding assembly; anoutput device providing an output periodic signal as a function ofdisplacement of the rotor relative to the stator winding assembly; and acontroller energizing the stator winding assembly and receiving theoutput periodic signal, the controller including a selection devicereceiving the output periodic signal and selecting whether to countevery periodic occurrence, every other periodic occurrence, or everyfourth periodic occurrence, the controller measuring a time duration fora plurality of first periodic occurrences of the output periodic signalto occur wherein every periodic occurrence, every other or every fourthperiodic occurrence is counted, counting a number of second periodicoccurrences of the output periodic signal to occur in a selected timeperiod wherein every periodic occurrence, every other or every fourthperiodic occurrence is counted, and calculating a speed of the movingmember as a function of the time duration for the plurality of firstperiodic occurrences to occur and the number of second periodicoccurrences to occur in the selected time period.
 20. The electric motorof claim 19 wherein the rotor rotates relative to the stator windingassembly.
 21. The electric motor of claim 19 wherein the rotor moveslinearly relative to the stator winding assembly.
 22. The electric motorof claim 19 wherein the controller calculates the speed of the movingmember as a function of: Speed=K*N/T where, N is the number of secondperiodic occurrences in the selected time period, T is the time durationfor the plurality of first periodic occurrences to occur, and K is ascaling value.
 23. The electric motor of claim 19 wherein the outputdevice comprises at least one of an encoder, a resolver and aHall-effect sensor.
 24. The electric motor of claim 19 wherein thecontroller includes a processing circuit.
 25. The electric motor ofclaim 19 wherein the controller includes a processor and a set ofinstructions stored in a processor readable medium, the set ofinstructions operable on the processor to calculate the speed of themoving member.
 26. The electric motor of claim 19 wherein each of thefirst periodic occurrences and each of the second periodic occurrencesare the same feature of the output periodic signal.
 27. An apparatus forcalculating a speed of a moving member based on an output periodicsignal as a function of displacement of the moving member, the apparatuscomprising: means for selecting whether to count every periodicoccurrence, every other periodic occurrence, or every fourth periodicoccurrence of the output signal of the output periodic signal to providea time duration output indicative of a time duration for a plurality offirst periodic occurrences of the output periodic signal to occur, andto provide a counter output indicative of a number of second periodicoccurrences of the output periodic signal to occur in a selected timeperiod; and a module receiving the time duration output and the counteroutput and calculating a speed of the moving member as a function of thetime duration output and the counter output.
 28. The apparatus of claim27 wherein the module comprises a processing circuit.
 29. The apparatusof claim 27 and further comprising a processor, and wherein the modulecomprises a set of instructions stored in a processor readable medium,the set of instructions operable on the processor to calculate the speedof the moving member.